﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;
using DTO;
using DAO;
namespace Banking.Member
{
    public partial class ThongTinTaiKhoanTietKiem : UserControl
    {
        TypeDemo _type;
        public ThongTinTaiKhoanTietKiem(TypeDemo type)
        {
            InitializeComponent();
            _type = type;
        }

        public void Init(int ma)
        {
            List<TaiKhoanTietKiem> ds = TaiKhoanTietKiemDA.GetByMaTaiKhoanChinh(ma,_type.typeDemo);
            foreach(var item in ds){
                item.ChiTietLaiSuat = ChiTietLaiSuatDA.GetByID(item.MaChiTietLS);
            }
            dgvTaiKhoan.DataSource = ds;
            dgvTaiKhoan.Columns["MaTKChinh"].Visible = false;
            dgvTaiKhoan.Columns["MaChiTietLS"].Visible = false;
            dgvTaiKhoan.Columns["DelFlg"].Visible = false;
            dgvTaiKhoan.Columns["MaLoaiTK"].Visible = false;
            dgvTaiKhoan.Columns["colSoTien"].DefaultCellStyle.Format = "0";
        }

    }
}
